﻿#region 命名空间

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using WinnerCMS.BLL;
using WinnerCMS.Common;
using WinnerCMS.Model;

#endregion

namespace WinnerCMS.WebUI.Admin.Controllers
{
    public class PhotoController : ApiController
    {
        /// <summary>
        ///     加载图片集
        /// </summary>
        /// <param name="contentId"></param>
        /// <param name="tempFlag"></param>
        /// <returns></returns>
        [HttpGet]
        public IList<PhotoList> Load(int contentId, string tempFlag)
        {
            return new PhotoListManage().GetList(contentId, tempFlag);
        }

        public PhotoList Upload()
        {
            return new PhotoListManage().Upload(HttpContext.Current);
        }

        public Result Delete(int id)
        {
            return new PhotoListManage().Delete(id);
        }

        public Result UpdatetTitle(int id, string title)
        {
            return new PhotoListManage().UpdateTitle(id, title);
        }

        public Result MoveOrderId(MoveInfo info)
        {
            return new PhotoListManage().MoveOrderId(info.Ids, info.ContentId, info.TempFlag);
        }

        public class MoveInfo
        {
            public int[] Ids { get; set; }
            public int ContentId { get; set; }
            public string TempFlag { get; set; }
        }
    }
}